//
// CPSRibbon.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;
import org.ryzom.nel.misc.IStream;

public class CPSRibbon extends CPSColoredParticle {
  private long swigCPtr;

  public CPSRibbon(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CPSRibbon_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSRibbon obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSRibbon(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void serial(IStream f) {
    nel3dJNI.CPSRibbon_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void setColorFading(boolean onOff) {
    nel3dJNI.CPSRibbon_setColorFading__SWIG_0(swigCPtr, this, onOff);
  }

  public void setColorFading() {
    nel3dJNI.CPSRibbon_setColorFading__SWIG_1(swigCPtr, this);
  }

  public boolean getColorFading() {
    return nel3dJNI.CPSRibbon_getColorFading(swigCPtr, this);
  }

  public void setOrientation(CPSRibbon.TOrientation orientation) {
    nel3dJNI.CPSRibbon_setOrientation(swigCPtr, this, orientation.swigValue());
  }

  public CPSRibbon.TOrientation getOrientation() {
    return CPSRibbon.TOrientation.swigToEnum(nel3dJNI.CPSRibbon_getOrientation(swigCPtr, this));
  }

  public void step(TPSProcessPass pass) {
    nel3dJNI.CPSRibbon_step(swigCPtr, this, pass.swigValue());
  }

  public boolean hasTransparentFaces() {
    return nel3dJNI.CPSRibbon_hasTransparentFaces(swigCPtr, this);
  }

  public boolean hasOpaqueFaces() {
    return nel3dJNI.CPSRibbon_hasOpaqueFaces(swigCPtr, this);
  }

  public long getNumWantedTris() {
    return nel3dJNI.CPSRibbon_getNumWantedTris(swigCPtr, this);
  }

  public void setTexture(SWIGTYPE_p_NLMISC__CSmartPtrT_NL3D__ITexture_t tex) {
    nel3dJNI.CPSRibbon_setTexture(swigCPtr, this, SWIGTYPE_p_NLMISC__CSmartPtrT_NL3D__ITexture_t.getCPtr(tex));
  }

  public void setTexFactor(float uFactor, float vFactor) {
    nel3dJNI.CPSRibbon_setTexFactor__SWIG_0(swigCPtr, this, uFactor, vFactor);
  }

  public void setTexFactor(float uFactor) {
    nel3dJNI.CPSRibbon_setTexFactor__SWIG_1(swigCPtr, this, uFactor);
  }

  public void setTexFactor() {
    nel3dJNI.CPSRibbon_setTexFactor__SWIG_2(swigCPtr, this);
  }

  public float getUFactor() {
    return nel3dJNI.CPSRibbon_getUFactor(swigCPtr, this);
  }

  public float getVFactor() {
    return nel3dJNI.CPSRibbon_getVFactor(swigCPtr, this);
  }

  public ITexture getTexture() {
    long cPtr = nel3dJNI.CPSRibbon_getTexture__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public void setShape(CVector shape, long nbPointsInShape, boolean braceMode) {
    nel3dJNI.CPSRibbon_setShape__SWIG_0(swigCPtr, this, CVector.getCPtr(shape), shape, nbPointsInShape, braceMode);
  }

  public void setShape(CVector shape, long nbPointsInShape) {
    nel3dJNI.CPSRibbon_setShape__SWIG_1(swigCPtr, this, CVector.getCPtr(shape), shape, nbPointsInShape);
  }

  public boolean getBraceMode() {
    return nel3dJNI.CPSRibbon_getBraceMode(swigCPtr, this);
  }

  public long getNbVerticesInShape() {
    return nel3dJNI.CPSRibbon_getNbVerticesInShape(swigCPtr, this);
  }

  public void getShape(CVector shape) {
    nel3dJNI.CPSRibbon_getShape(swigCPtr, this, CVector.getCPtr(shape), shape);
  }

  public static CVector getLosange() {
    long cPtr = nel3dJNI.CPSRibbon_Losange_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInLosange() {
    return nel3dJNI.CPSRibbon_NbVerticesInLosange_get();
  }

  public static CVector getHeightSides() {
    long cPtr = nel3dJNI.CPSRibbon_HeightSides_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInHeightSide() {
    return nel3dJNI.CPSRibbon_NbVerticesInHeightSide_get();
  }

  public static CVector getPentagram() {
    long cPtr = nel3dJNI.CPSRibbon_Pentagram_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInPentagram() {
    return nel3dJNI.CPSRibbon_NbVerticesInPentagram_get();
  }

  public static CVector getTriangle() {
    long cPtr = nel3dJNI.CPSRibbon_Triangle_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInTriangle() {
    return nel3dJNI.CPSRibbon_NbVerticesInTriangle_get();
  }

  public static CVector getSimpleSegmentX() {
    long cPtr = nel3dJNI.CPSRibbon_SimpleSegmentX_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInSimpleSegmentX() {
    return nel3dJNI.CPSRibbon_NbVerticesInSimpleSegmentX_get();
  }

  public static CVector getSimpleSegmentY() {
    long cPtr = nel3dJNI.CPSRibbon_SimpleSegmentY_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInSimpleSegmentY() {
    return nel3dJNI.CPSRibbon_NbVerticesInSimpleSegmentY_get();
  }

  public static CVector getSimpleSegmentZ() {
    long cPtr = nel3dJNI.CPSRibbon_SimpleSegmentZ_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInSimpleSegmentZ() {
    return nel3dJNI.CPSRibbon_NbVerticesInSimpleSegmentZ_get();
  }

  public static CVector getSimpleBrace() {
    long cPtr = nel3dJNI.CPSRibbon_SimpleBrace_get();
    return (cPtr == 0) ? null : new CVector(cPtr, false);
  }

  public static long getNbVerticesInSimpleBrace() {
    return nel3dJNI.CPSRibbon_NbVerticesInSimpleBrace_get();
  }

  public boolean hasLightableFaces() {
    return nel3dJNI.CPSRibbon_hasLightableFaces(swigCPtr, this);
  }

  public boolean supportGlobalColorLighting() {
    return nel3dJNI.CPSRibbon_supportGlobalColorLighting(swigCPtr, this);
  }

  public void enumTexs(SWIGTYPE_p_std__vectorT_NLMISC__CSmartPtrT_NL3D__ITexture_t_t dest, IDriver drv) {
    nel3dJNI.CPSRibbon_enumTexs(swigCPtr, this, SWIGTYPE_p_std__vectorT_NLMISC__CSmartPtrT_NL3D__ITexture_t_t.getCPtr(dest), IDriver.getCPtr(drv), drv);
  }

  public void setZBias(float value) {
    nel3dJNI.CPSRibbon_setZBias(swigCPtr, this, value);
  }

  public float getZBias() {
    return nel3dJNI.CPSRibbon_getZBias(swigCPtr, this);
  }

  public final static class TOrientation {
    public final static TOrientation FollowPath = new TOrientation("FollowPath", nel3dJNI.CPSRibbon_FollowPath_get());
    public final static TOrientation FollowPathXY = new TOrientation("FollowPathXY");
    public final static TOrientation Identity = new TOrientation("Identity");
    public final static TOrientation OrientationCount = new TOrientation("OrientationCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TOrientation swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TOrientation.class + " with value " + swigValue);
    }

    private TOrientation(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TOrientation(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TOrientation(String swigName, TOrientation swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TOrientation[] swigValues = { FollowPath, FollowPathXY, Identity, OrientationCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
